import VueRouter from "vue-router";
//引入组件
import Login from "../components/Login.vue";
import Register from "../components/Register.vue";
import Layout from "../components/Layout.vue";
import MainPage from "../pages/MainPage.vue";
import vegtation from "../components/Vegetation.vue";
import Analog from "../pages/Analog.vue";
import Analyse from "../pages/Analyse.vue";
import arcgis from "../components/arcgisMap.vue";
import DataManage from "../pages/DataManage.vue";
const router = new VueRouter({
  routes: [
    {
      path: "/",
      redirect: "/login",
    },
    {
      name: "Login",
      path: "/login",
      component: Login,
    },
    {
      name: "register",
      path: "/register",
      component: Register,
    },
    {
      path: "/",
      component: Layout, //布局组件
      redirect: "/mainpage",
      //子组件
      children: [
        {
          name: "MainPage",
          path: "/mainpage",
          component: MainPage,
        },
        {
          name: "Analyse",
          path: "/analyse",
          component: Analyse,
        },
        {
          name: "Analog",
          path: "/analog",
          component: Analog,
        },
        {
          path: "/data",
          name: "DataManage",
          component: DataManage,
        },
      ],
    },
    {
      name: "arcgis",
      path: "/arcgis",
      component: arcgis,
    },
    {
      name: "veg",
      path: "/veg",
      component: vegtation,
    },
  ],
});
export default router;
